<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
		<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
		<html>
		<head>
			<title>表单代码示例</title>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
			<jsp:include page="/WEB-INF/views/include/newhead.jsp" />
			<%@include file="/WEB-INF/views/include/treeview.jsp"%>
		</head>
		<body class="childrenBody site-block">
			<header class="larry-personal-tit">
				<span>
					常用表单示例
				</span>
			</header>
			
			<div class="mainCon">
				<form:form id="inputForm" autocomplete="off" modelAttribute="user"  method="post">
					<form:hidden path="id"/>
					<sys:message content="${message}"/>
					
					        <div class="layui-form-item">
							    <div class="layui-inline">
							      <label class="layui-form-label"><font color="red">*</font>验证邮箱验证邮箱</label>
							      <div class="layui-input-inline">
							          <input type="text" name="phone" placeholder="左边文字最长支持8个文字" class="layui-input required" >
							      </div>
							    </div>
							    <div class="layui-inline">
							      <label class="layui-form-label">验证邮箱验证邮箱</label>
							      <div class="layui-input-inline">
							        <input type="text" name="email" placeholder="左边文字最长支持8个文字" class="layui-input">
							      </div>
							    </div>
							</div>
							
							<div class="layui-form-item">
							    <div class="layui-inline">
								<label class="layui-form-label">下拉框</label>
								<div class="layui-input-inline">
									<form:select path="id" cssClass="select2_ " >
										<form:option value="" label="请选择"/>
										<form:options items="${fns:getDictList('sys_user_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
									</form:select>    
								</div>
							    </div>
							    <div class="layui-inline">
								<label class="layui-form-label">用户类型</label>
								<div class="layui-input-inline">
									<form:select path="id" cssClass="select2_ " >
										<form:option value="" label="请选择"/>
										<form:options items="${fns:getDictList('sys_user_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
									</form:select>    
								</div>
							    </div>
		                    </div>
		                    
		                    <div class="layui-form-item">
		                       <div class="layui-inline">
								    <label class="layui-form-label">多选框</label>
								    <!-- layui-input-inline-one 占一行 -->
								    <div class="layui-input-inline layui-input-inline-one">
								     <div class="checkbox icheck-nephritis checkbox-extend">
										<input type="checkbox" checked id="java" />
										<label for="java">java</label>
			                          </div>
			                          <div class="checkbox icheck-nephritis checkbox-extend">
										<input type="checkbox" checked id=".net" />
										<label for=".net">.net</label>
			                         </div>
			                         <div class="checkbox icheck-nephritis checkbox-extend">
										<input  disabled="disabled" id="c++" />
										<label for="c++">c++</label>
			                         </div>
								    </div>
							    </div>
                           </div>
                           
                           <div class="layui-form-item">
		                       <div class="layui-inline">
								    <label class="layui-form-label">单选框1</label>
								    <!-- layui-input-inline-one 占一行 -->
								    <div class="layui-input-inline">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input type="radio" id="boy" name="sex"/>
										<label for="boy">男</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input type="radio" id="girl" name="sex" />
										<label for="girl">女</label>
			                         </div>
								    </div>
							    </div>
                           </div>
							
						   <div class="layui-form-item">
						       <div class="layui-inline">
							    <label class="layui-form-label">单行输入框</label>
							    <div class="layui-input-inline layui-input-inline-one">
							      <input type="text" name="title" placeholder="请输入单行输入框" class="layui-input">
							    </div>
							   </div>
                           </div>
					
							<div class="layui-form-item">
								<label class="layui-form-label">备注信息</label>
								<div class="layui-input-inline layui-input-inline-one">
									<form:textarea path="remarks" placeholder="请输入备注信息" htmlEscape="false" rows="4" maxlength="255" class="layui-textarea"/>
								</div>
							</div>
							
							<div class="layui-form-item">
									<label class="layui-form-label">结构树</label>
									<div class="layui-input-inline layui-input-inline-one">
										<sys:treeselect id="company" name="company.id" value="${user.company.id}" 
							 				labelName="company.name" labelValue="${user.company.name}" allowClear="true"
											title="公司" url="/sys/office/treeData?type=1&isReadCache=false"  
											cssClass="layui-input  layui-input-treeselect required"/>
									</div>
							</div>
							
							<div class="layui-form-item">
								<label class="layui-form-label">弹框列表</label>
								<div class="layui-input-inline layui-input-inline-one">
							      <sys:dialogTableSelect id="role" name="roleIds" value="${user.roleIds}"
									cssClass="layui-input layui-input-treeselect required" labelName="" labelValue="${user.roleNames}" title="岗位列表"
									width="1000" tableSelectId="id" tableSelectName="name" height="600" allowClear="false"
									includeUrl="/WEB-INF/views/modules/sys/roleListBydialog.jsp?roleType=1"
									singleSelect="false" params=""  draggable="true"/>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">富文本</label>
								<div class="layui-input-inline layui-input-inline-one">
										<form:textarea id="photo" path="photo"  htmlEscape="true" rows="4" maxlength="200" class="input-xxlarge"/>
										<sys:ckeditor replace="photo" uploadPath="/cms/site" height="200px" />
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">简单的上传附件</label>
								<div class="layui-input-inline layui-input-inline-one">
									<form:hidden path="phone" htmlEscape="false" maxlength="255" class="input-xlarge"/>
									<sys:ckfinder input="phone" type="images" uploadPath="/cms/site"/>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">上传附件说明</label>
								<div class="layui-input-inline layui-input-inline-one">
								    sys:ckfinder控件中input="phone"中phone为上传后把值复制到对应隐藏文本id，<br/>
								           提交后即可保存当前附件的相对路径，也就是只需要在实体对象中，创建一个存url的字段即可
								    ,然后根据上面的例子即可完成上传。<br/>
								     type有files、images、flash、thumb四个类型。<br/>
								     uploadPath相对路径地址
								</div>
							</div>
					
					<div class="layui-form-item bottom_xf">
						<div class="layui-input-block layui-input-inline-one">
							<button type="button" class="layui-btn layui-btn-primary" onclick="window.history.go(-1);">返回</button>
							<button class="layui-btn" type="submit">保存</button>
							<button onclick="formReset();" type="button"  class="layui-btn layui-btn-danger">重置</button>
						</div>
					</div>
				</form:form>
			</div>
			
			<script type="text/javascript">
				$(document).ready(function() {
					$("#inputForm").validate({
						submitHandler: function(form){
							loading('正在提交，请稍等...');
							form.submit();
						},
					/**	rules: {
						
						},
						messages: {
						
						}, */
						errorContainer: "#messageBox",
						errorPlacement: function(error, element) {
							$("#messageBox").text("输入有误，请先更正。");
							if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
								error.appendTo(element.parent().parent());
							} else {
								error.insertAfter(element);
							}
						}
					});
				});
			</script>
		</body>
		</html>